package com.compunit.composite.core.interfaces;

import java.io.IOException;
import java.net.URL;
import java.util.Properties;

/**
 * <code>IConfigurationImporter</code> defines interface
 * of an importer unit that is responsible for loading
 * a configuration XML file and return <code>Properties</code>
 * data structure with information in the file.
 *
 * @author Yi Wang (Neakor)
 * @version Creation date: 12-05-2009 14:52 EST
 * @version Modified date: 12-05-2009 15:23 EST
 */
public interface IConfigurationImporter {

	/**
	 * Load the XML file linked by given URL.
	 * @param file The <code>URL</code> to the data file.
	 * @return The <code>Properties</code> data structure.
	 * @throws IOException If file handling failed.
	 */
	public void process(final URL file) throws IOException;

	/**
	 * Retrieve the properties associated with the
	 * component with given fully qualified class
	 * name.
	 * @param classname The <code>String</code> fully
	 * qualified class name.
	 * @return The <code>Properties</code> associated
	 * with the component.
	 */
	public Properties get(final String classname);
	
	/**
	 * Cleanup the cached properties data.
	 */
	public void cleanup();
}
